# heading ----
rm(list = ls())
Sys.setenv(LANG = "en")
message(paste0("Date: ", format(Sys.Date(), "%d %B %Y")),
        "\n",
        paste0("By: ", "Cedric Chambru & Paul Maneuvrier-Hervieu"),
        "\n",
        paste0("Description: ", "code - master code to execute R code files"),
        "\n",
        paste0("Version of R used: ", R.Version()$version.string))


# install and load libraries ----
# packageVersion("[package_name]")
if(!require("pacman")) install.packages("pacman")
pacman::p_load(
        tidyverse,       # data management and visualization
        tidylog,         # feedback on data management
        extrafont        # font package
)


# load fonts ----
windowsFonts(UbuntuRegular = windowsFont("UbuntuRegular"))


# set folder paths ----
source("r_functions/folder_paths_article.R")


# load functions ----
source(paste0(dir_function, "time_var.R"), encoding = "UTF-8")
source(paste0(dir_function, "theme_figures.R"), encoding = "UTF-8")


# execute R scripts:  ----
source("03_hiscod_tables.R")
source("04_hiscod_figures.R")


# clean workspace ----
rm(list = ls())
file.remove(".Rhistory")

